﻿using System;
using System.IO;
using UnityEditor;
using UnityEngine;

// Token: 0x02000004 RID: 4
internal static class ProjectSpecificEditorPrefs
{
	// Token: 0x06000003 RID: 3 RVA: 0x000090B4 File Offset: 0x000072B4
	private static string GetProjectUniqueKey(string key)
	{
		string name = new DirectoryInfo(Application.dataPath).Parent.Name;
		return name + "_" + key;
	}

	// Token: 0x06000004 RID: 4 RVA: 0x000090E8 File Offset: 0x000072E8
	public static void SetInt(string key, int value)
	{
		string projectUniqueKey = ProjectSpecificEditorPrefs.GetProjectUniqueKey(key);
		EditorPrefs.SetInt(projectUniqueKey, value);
	}

	// Token: 0x06000005 RID: 5 RVA: 0x00009108 File Offset: 0x00007308
	public static int GetInt(string key, int defaultValue = 0)
	{
		string projectUniqueKey = ProjectSpecificEditorPrefs.GetProjectUniqueKey(key);
		return EditorPrefs.GetInt(projectUniqueKey, defaultValue);
	}

	// Token: 0x06000006 RID: 6 RVA: 0x000028FD File Offset: 0x00000AFD
	public static void SetBool(string key, bool value)
	{
		ProjectSpecificEditorPrefs.SetInt(key, value ? 1 : 0);
	}

	// Token: 0x06000007 RID: 7 RVA: 0x00009128 File Offset: 0x00007328
	public static bool GetBool(string key, bool defaultValue = false)
	{
		return ProjectSpecificEditorPrefs.GetInt(key, defaultValue ? 1 : 0) != 0;
	}

	// Token: 0x06000008 RID: 8 RVA: 0x0000914C File Offset: 0x0000734C
	public static void SetString(string key, string value)
	{
		string projectUniqueKey = ProjectSpecificEditorPrefs.GetProjectUniqueKey(key);
		EditorPrefs.SetString(projectUniqueKey, value);
	}

	// Token: 0x06000009 RID: 9 RVA: 0x0000916C File Offset: 0x0000736C
	public static string GetString(string key, string defaultValue = "")
	{
		string projectUniqueKey = ProjectSpecificEditorPrefs.GetProjectUniqueKey(key);
		return EditorPrefs.GetString(projectUniqueKey, defaultValue);
	}

	// Token: 0x0600000A RID: 10 RVA: 0x0000918C File Offset: 0x0000738C
	public static void DeleteKey(string key)
	{
		string projectUniqueKey = ProjectSpecificEditorPrefs.GetProjectUniqueKey(key);
		EditorPrefs.DeleteKey(projectUniqueKey);
	}

	// Token: 0x0600000B RID: 11 RVA: 0x000091A8 File Offset: 0x000073A8
	public static bool HasKey(string key)
	{
		string projectUniqueKey = ProjectSpecificEditorPrefs.GetProjectUniqueKey(key);
		return EditorPrefs.HasKey(projectUniqueKey);
	}

	// Token: 0x0600000C RID: 12 RVA: 0x000091C8 File Offset: 0x000073C8
	public static void SetDateTime(string key, DateTime dateTime)
	{
		ProjectSpecificEditorPrefs.SetString(key, dateTime.ToBinary().ToString());
	}

	// Token: 0x0600000D RID: 13 RVA: 0x000091EC File Offset: 0x000073EC
	public static DateTime GetDateTime(string key, DateTime defaultValue = default(DateTime))
	{
		string @string = ProjectSpecificEditorPrefs.GetString(key, string.Empty);
		bool flag = string.IsNullOrEmpty(@string);
		DateTime result;
		if (flag)
		{
			result = defaultValue;
		}
		else
		{
			long dateData = Convert.ToInt64(@string);
			DateTime dateTime = DateTime.FromBinary(dateData);
			result = dateTime;
		}
		return result;
	}
}
